
<%@ page contentType="text/html;charset=UTF-8"  language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../../static/shopping/js/jquery-1.8.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../static/shopping/css/style.css"></link>
    <link rel="stylesheet" type="text/css" href="../../static/shopping/css/table.css"></link>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <script>
        var a = 2;
        var userlist = null;
        function  test(){

            $.ajax({
                url:"${pageContext.request.contextPath}/user",
                success:function (data) {
                    console.log(data)
                    userlist = data
                }

            })

        }
    </script>
    <style type="text/css">
        table {margin: auto;} body{text-align: center;position: absolute;top: 50%;left: 50%;margin-left: -50px;margin-top: -50px}
    </style>
</head>
<table class="table table-bordered" id="biao">
    <thead>
        <tr>
            <td>用户id</td>
            <td>用户名</td>
            <td>密码</td>
            <td>操作</td>
        </tr>
    </thead>

<c:forEach items="${users}" var="user">
    <tr>
        <td>${user.id}</td>
        <td>${user.account}</td>
        <td>${user.password}<td>
        <td><button type="button" value="id='${user.id}'&account='${user.account}'&password='${user.password}'" class="btn btn-danger" onclick="xiugai('id=${user.id}&account=${user.account}&password=${user.password}')">修改</button>
        <button type="button" value="id = '${user.id}'" onclick="delete1('id=${user.id}')">删除</button>
    </td>

    </tr>
</c:forEach>
</table>
<script>
    function xiugai(t1) {
        window.location.href="${pageContext.request.contextPath}/xiugai?"+t1;


    }
</script>

<script >
    function delete1(t2) {
        window.location.href="${pageContext.request.contextPath}/delete?"+t2
    }
</script>
</body>
</html>
